﻿using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;

namespace LeetCode刷题
{
    public class L0035
    {
        public static void Run()
        {
            int[] nums = new int[] { 1, 3, 5, 6, 7 };
            int target = 5;
            int ret = SearchInsert(nums, 9);
            Console.WriteLine(ret.ToString());
        }

        private static int SearchInsert(int[] nums, int target)
        {
            int i = 0;
            for (i = 0; i < nums.Length; i++)
            {
                if (target <= nums[i])
                {
                    return i;
                }

            }
            return i++;
        }

        
    }
}
